﻿namespace SerialInput;

public class SerialPortConfig
{
    /// <summary>
    /// 1: 剪切板发送
    /// 2：字符串输入
    /// 3：mqtt发送
    /// 4：http发送
    /// </summary>
    public int Type { get; set; }
    /// <summary>
    /// 串口名称，如 COM3
    /// </summary>
    public string? PortName { get; set; }
    /// <summary>
    /// 串口查找名称，如 USB Serial Device
    /// </summary>
    public string Name { get; set; } = "";
    public int BaudRate { get; set; } = 9600;
    public int DataBits { get; set; } = 8;
    public int StopBits { get; set; } = 1;
    public string Parity { get; set; } = "None";
    public int ReadTimeout { get; set; } = 300;
    public int WriteTimeout { get; set; } = 300;
    /// <summary>
    /// 编码格式，默认 UTF-8
    /// </summary>
    public string Encoding { get; set; }= "UTF-8";
    /// <summary>
    /// mqtt连接字符串，如 localhost:1883:backend:5PibfhEhmoNXZcK2
    /// http连接字符串，如 http://localhost:5000/api/barcode
    /// </summary>
    public string? Conn { get; set; }
    /// <summary>
    /// mqtt主题
    /// </summary>
    public string? Topic { get; set; }
}